package com.example.administrator.shzs.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * 商家详情Adapter
 */

public class ShopDatrilsAdapter extends FragmentPagerAdapter {

    private List<Fragment> mFragments;
    private List<String> mTitles;


    public ShopDatrilsAdapter(FragmentManager fm, List<Fragment> mFragments, Context context, List<String> mTiltles) {
        super(fm);
        this.mFragments = mFragments;
        this.mTitles = mTiltles;
    }

    @Override
    public int getCount() {
        return mFragments == null? 0: mFragments.size();
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position);
    }

}
